package com.iptv.grape.event;

public class EventArgs {
    // 事件名称
    private String eventName;
    // 事件类型
    private String eventType;
    // 事件参数
    private Object eventArgs = null;
    // 原始的Json字符串
    private String json;
    // 是否存在事件参数,换句话说eventArgs不为空则isExistsArgs == true
    private boolean isExistsArgs;
    // 构造函数
    public EventArgs(String eventName,String eventType,Object eventArgs) {
        this.eventName = eventName;
        this.eventType = eventType;
        this.eventArgs = eventArgs;
        this.isExistsArgs = this.eventArgs != null;
    }

    // 构造函数
    public EventArgs(String eventName,String eventType,Object eventArgs,String json) {
        this.eventName = eventName;
        this.eventType = eventType;
        this.eventArgs = eventArgs;
        this.isExistsArgs = this.eventArgs != null;
        this.json = json;
    }

    // 构造函数
    public EventArgs(String eventName,String eventType) {
        this.eventName = eventName;
        this.eventType = eventType;
        this.isExistsArgs = false;
    }
    // 事件名称
    public String getEventName() {
        return this.eventName;
    }
    // 事件类型
    public String getEventType() {
        return this.eventType;
    }
    // 事件参数
    public Object getEventArgs() {
        return this.eventArgs;
    }
    // 是否存在事件参数,换句话说eventArgs不为空则isExistsArgs == true
    public boolean getIsExistsArgs(){
        return this.isExistsArgs;
    }

    //
    public String getJson(){
        return this.json;
    }

}
